package com.item.controller;


import com.item.pojo.Comment;
import com.item.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;


    @GetMapping
    public List<Comment> selectAll(){
        return commentService.selectAll();
    }

    @PutMapping
    public int insert(@RequestBody Comment comment){
        return commentService.insert(comment);
    }

    @PostMapping
    public int update(@RequestBody Comment comment){
        return commentService.update(comment);
    }


}
